import { h } from 'vue';
import { NTag } from 'naive-ui';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '交易单号',
    key: 'danhao',
    align: "center",
  }, {
    title: '申请时间',
    key: 'create_time',
    align: "center",
  }, {
    title: '用户名',
    key: 'username',
    align: "center",
  }, {
    title: '角色',
    key: 'role_id',
    align: "center",
    render(row) {
      if (row.role_id == 10) {
        return h(
          NTag,
          {
            type: 'warning',
          },
          {
            default: () => ('用户'),
          },
        );
      } else if (row.role_id == 11) {
        return h(
          NTag,
          {
            type: 'warning',
          },
          {
            default: () => ('代理商'),
          },
        );
      } else if (row.role_id == 12) {
        return h(
          NTag,
          {
            type: 'warning',
          },
          {
            default: () => ('商户'),
          },
        );
      } else {
        return h(
          NTag,
          {
            type: 'warning',
          },
          {
            default: () => ('员工'),
          },
        );
      }
    }
  }, {
    title: '手机号',
    key: 'tell',
    align: "center",
  }, {
    title: '提现金额',
    key: 'yuanmoney',
    align: "center",
  }, {
    title: '手续费',
    key: 'shouxufei',
    align: "center",
  }, {
    title: '实际打款',
    key: 'money',
    align: "center",
  }, {
    title: '打款方式',
    key: 'pingtai',
    align: "center",
    render(row) {
      if (row.pingtai == 1) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('微信'),
          },
        );
      } else if (row.pingtai == 2) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('抖音'),
          },
        );
      } else if (row.pingtai == 3) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('支付宝'),
          },
        );
      } else {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('其他'),
          },
        );
      }
    }
  }, {
    title: '状态',
    key: 'status',
    align: "center",
    render(row) {
      if (row.status == 0) {
        return h(
          NTag,
          {
            type: 'info',
          },
          {
            default: () => ('待审核'),
          },
        );
      } else if (row.status == 1) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('提现成功'),
          },
        );
      } else if (row.status == 2) {
        return h(
          NTag,
          {
            type: 'warning',
          },
          {
            default: () => ('撤回'),
          },
        );
      } else if (row.status == 3) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('退回'),
          },
        );
      } else if (row.status == 4) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('失败'),
          },
        );
      } else if (row.status == 5) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('审核中'),
          },
        );
      }
    }
  }
];
